package com.gzq.controller;

import com.gzq.service.TeamService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("team")
public class TeamController {
    @Resource
    TeamService teamService;

    /**
     * 查找所有
     * @return
     */
    @RequestMapping("findall")
    public Map findAll(@RequestParam("page") int page){
        Map map = new HashMap();
        map.put("team",teamService.findAll(page));
        return map;
    }
    /**
     * 查找团队成员
     * team表中status为0表示教员(leader)
     * @return
     */
    @RequestMapping("findteam")
    public Map findLeader(@RequestParam("team") String team){
        Map map = new HashMap();
        map.put("team",teamService.findByStatus(team));
        return map;
    }
    /**
     * 查找班级
     */
    @RequestMapping("findclass")
    public Map findClass(){
        Map map=new HashMap();
        map.put("class",teamService.findClass());
        return map;
    }

}
